package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.BusiProjectItem;
import com.ruoyi.system.domain.ProjectAndItem;
import com.ruoyi.system.mapper.BusiProjectItemMapper;
import com.ruoyi.system.service.ProjectItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProjectServiceItemImpl implements ProjectItemService {
    @Autowired
    BusiProjectItemMapper busiProjectItemMapper;

    @Override
    public List<BusiProjectItem> findByProjectId(String projectId) {
        return busiProjectItemMapper.findByProjectId(projectId);
    }

    @Override
    public BusiProjectItem findByItemId(String busiProjectItemId) {
        return busiProjectItemMapper.selectById(busiProjectItemId);
    }

    @Override
    public BusiProjectItem findByItemName(String name) {
        return busiProjectItemMapper.selectByName(name);
    }


    @Override
    public int insertItem(BusiProjectItem busiProjectItem) {
        return busiProjectItemMapper.insert(busiProjectItem);
    }

    @Override
    public int deleteItem(BusiProjectItem busiProjectItem) {
        return busiProjectItemMapper.deleteByPrimaryKey(busiProjectItem.getItemId());
    }

    @Override
    public int updateItem(BusiProjectItem busiProjectItem) {
        return busiProjectItemMapper.updateByPrimaryKey(busiProjectItem);
    }

    @Override
    public List<BusiProjectItem> show() {
        return busiProjectItemMapper.show();
    }

    @Override
    public List<ProjectAndItem> showAll() {
        return busiProjectItemMapper.showAll();
    }

    @Override
    public List<BusiProjectItem> find(String projectName, String projectCode, String itemName) {
        return busiProjectItemMapper.find(projectName,projectCode,itemName);
    }

}
